| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

GridLayout.h
1 // GridLayout.h
3 //
5
6 namespace nkWinUi
7 {
13 class GridLayout final : public Layout
14 {
15 public :
16
22 GridLayout (System* system) noexcept ;
26 GridLayout (const GridLayout&) = delete ;
30 virtual ~GridLayout () ;
31
32 // Getters
37 Component* getComponentAt (unsigned int index) const ;
45 Component* getComponentAt (unsigned int x, unsigned int y) const ;
49 unsigned int getGridWidth () const ;
53 unsigned int getGridHeight () const ;
58 float getFixedSizeRow (unsigned int index) const ;
63 float getFixedSizeCol (unsigned int index) const ;
68 float getWeightRow (unsigned int index) const ;
73 float getWeightCol (unsigned int index) const ;
80 nkMaths::Point getCellCoordinatesForPoint (nkMaths::Point point) const ;
81
82 // Setters
86 virtual void setParentComponent (Component* parent) override ;
93 void setGridWidth (unsigned int value) ;
100 void setGridHeight (unsigned int value) ;
106 void insertRow (unsigned int index) ;
112 void insertCol (unsigned int index) ;
118 void eraseRow (unsigned int index) ;
124 void eraseCol (unsigned int index) ;
131 void setFixedSizeRow (unsigned int rowIndex, float sizePix) ;
138 void setFixedSizeCol (unsigned int colIndex, float sizePix) ;
148 void setWeightRow (unsigned int rowIndex, float weight) ;
158 void setWeightCol (unsigned int colIndex, float weight) ;
164 void setInternalBorderWidth (float valuePix) ;
170 void setInternalBorderHeight (float valuePix) ;
180 void setIgnoreInternalBorderCell (unsigned int rowIndex, unsigned int colIndex, bool value) ;
181
182 // Components
197 void addComponent (Component* component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool resizeAllowed = false, bool updateLayout = true) ;
210 void updateComponentCellCoverage (Component* component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool updateLayout = true) ;
217 nkMaths::Rectangle getComponentCellCoverage (Component* component) const ;
221 virtual void removeComponent (Component* component) override ;
222
223 // Update
227 virtual void update () override ;
228
229 // Import / Export
233 virtual void exportClassToTree (nkExport::Node* rootNode) override ;
237 virtual void exportComponentsNodeEntry (nkExport::Node* rootNode) override ;
241 virtual void importClassFromTree (nkExport::Node* rootNode) override ;
245 virtual void processComponentsNodeEntry (nkExport::Node* rootNode) override ;
246
247 // Operators
251 GridLayout& operator= (const GridLayout&) = delete ;
252 } ;
253 }
nkWinUi::GridLayout::getComponentAt
Component * getComponentAt(unsigned int index) const
nkWinUi::GridLayout::setFixedSizeRow
void setFixedSizeRow(unsigned int rowIndex, float sizePix)
nkWinUi::GridLayout::setWeightCol
void setWeightCol(unsigned int colIndex, float weight)
nkWinUi::GridLayout::exportComponentsNodeEntry
virtual void exportComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::GridLayout::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkWinUi::GridLayout::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkWinUi::GridLayout::getComponentAt
Component * getComponentAt(unsigned int x, unsigned int y) const
nkWinUi::GridLayout::getWeightRow
float getWeightRow(unsigned int index) const
nkWinUi::GridLayout::GridLayout
GridLayout(System *system) noexcept
nkWinUi::Layout
Represents a layout to organize children of a component.
Definition: Layout.h:12
nkWinUi::GridLayout::update
virtual void update() override
nkWinUi::GridLayout::setWeightRow
void setWeightRow(unsigned int rowIndex, float weight)
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::System
The main system of the component.
Definition: System.h:18
nkWinUi::GridLayout::getGridHeight
unsigned int getGridHeight() const
nkWinUi::GridLayout::setIgnoreInternalBorderCell
void setIgnoreInternalBorderCell(unsigned int rowIndex, unsigned int colIndex, bool value)
nkWinUi::GridLayout::setFixedSizeCol
void setFixedSizeCol(unsigned int colIndex, float sizePix)
nkWinUi::GridLayout::getComponentCellCoverage
nkMaths::Rectangle getComponentCellCoverage(Component *component) const
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkMaths::Point
Represents a 2D Point.
Definition: Point.h:12
nkWinUi::GridLayout::insertRow
void insertRow(unsigned int index)
nkWinUi::GridLayout::eraseRow
void eraseRow(unsigned int index)
nkWinUi::GridLayout::insertCol
void insertCol(unsigned int index)
nkWinUi::GridLayout::operator=
GridLayout & operator=(const GridLayout &)=delete
nkWinUi::GridLayout::setParentComponent
virtual void setParentComponent(Component *parent) override
nkWinUi::GridLayout::getFixedSizeCol
float getFixedSizeCol(unsigned int index) const
nkWinUi::GridLayout::eraseCol
void eraseCol(unsigned int index)
nkWinUi::GridLayout::setInternalBorderHeight
void setInternalBorderHeight(float valuePix)
nkWinUi::GridLayout::~GridLayout
virtual ~GridLayout()
nkWinUi::GridLayout::updateComponentCellCoverage
void updateComponentCellCoverage(Component *component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool updateLayout=true)
nkWinUi::GridLayout::getCellCoordinatesForPoint
nkMaths::Point getCellCoordinatesForPoint(nkMaths::Point point) const
nkWinUi::GridLayout::addComponent
void addComponent(Component *component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool resizeAllowed=false, bool updateLayout=true)
nkMaths::Rectangle
Represents a 2D rectangle.
Definition: Rectangle.h:12
nkWinUi::GridLayout::setInternalBorderWidth
void setInternalBorderWidth(float valuePix)
nkWinUi::GridLayout::getFixedSizeRow
float getFixedSizeRow(unsigned int index) const
nkWinUi::GridLayout::getGridWidth
unsigned int getGridWidth() const
nkWinUi::GridLayout
Implements a layout organizing children components in a grid.
Definition: GridLayout.h:14
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Clipboard.h:7
nkWinUi::GridLayout::removeComponent
virtual void removeComponent(Component *component) override
nkWinUi::GridLayout::getWeightCol
float getWeightCol(unsigned int index) const
nkWinUi::GridLayout::setGridWidth
void setGridWidth(unsigned int value)
nkWinUi::GridLayout::processComponentsNodeEntry
virtual void processComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::GridLayout::GridLayout
GridLayout(const GridLayout &)=delete
nkWinUi::GridLayout::setGridHeight
void setGridHeight(unsigned int value)